﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MF.BO.Objects;
using MF.DAL.Core;

namespace MF.BL.Core
{
    public static partial class BusinessUtils
    {
        public static class TransactionService
        {
            public static List<TransactionItem> GetAllTransaction()
            {
                List<TransactionItem> toReturn = new List<TransactionItem>();

                try
                {
                    toReturn = DALUtils.TransactionDB.GetAllTransaction();
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return toReturn;
            }

            public static int Insert(TransactionItem toInsert)
            {
                int toReturn = 0;

                try
                {
                    toReturn = DALUtils.TransactionDB.Insert(toInsert);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return toReturn;
            }

            public static int Update(TransactionItem toUpdate)
            {
                int toReturn = 0;

                try
                {
                    toReturn = DALUtils.TransactionDB.Update(toUpdate);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return toReturn;
            }

            public static int Delete(int idToDelete)
            {
                int toReturn = 0;

                try
                {
                    toReturn = DALUtils.TransactionDB.Delete(idToDelete);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                return toReturn;
            }
        }
    }
}
